<template>
  <div class="app-container">
    <el-table
      :data="tableData"
      stripe
      border
      style="width: 100%"
    >
      <el-table-column
        prop="id"
        label="id"
      />
      <el-table-column
        prop="mobile"
        label="手机号"
      />
      <el-table-column
        prop="username"
        label="昵称"
      />
    </el-table>
  </div>
</template>

<script>
import { getUserList } from '@/api/user'

export default {
  data() {
    return {
      tableData: []
    }
  },
  created() {
    this.getList()
  },

  methods: {
    getList: function() {
      getUserList().then(res => {
        const { data } = res
        this.tableData = data
      })
    }
  }
}
</script>

